#-*- coding:utf-8 -*-
import sys
import json
reload(sys)
sys.setdefaultencoding('utf8')
import os

G_base_path =r'C:\CgTeamWork_v6\bin'
# G_base_path = os.path.dirname(os.path.dirname(__file__.replace("\\", "/")))
G_com_path = G_base_path + "/base/com_lib"
G_cgtw_path = G_base_path + "/base"
G_cgtw_pyside = G_base_path +'/lib/pyside'

if not G_base_path in sys.path:
    sys.path.append(G_base_path)
if not G_com_path in sys.path:
    sys.path.append(G_com_path)
if not G_cgtw_path in sys.path:
    sys.path.append(G_cgtw_path)
if not G_cgtw_pyside in sys.path:
    sys.path.append(G_cgtw_pyside)

from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
# from com_message_box import *

import cgtw2

def a():
    t_tw = cgtw2.tw()
    t_tw.task.set('proj_pltest', 'shot', ['C67E75D5-1C59-235D-26C4-33C2D87695B4'], {'task.status': 'Wait'})

def create_note(database,module,task_id,note):#astype
    t_tw = cgtw2.tw()
    # t_tw.note.create(database,'shot' ,'task', [task_id], note)#astype,
    # t_tw.note.create(database, 'shot', 'task', [task_id], json.loads(note))
    t_tw.note.create(database, module, 'task', [task_id], json.loads(note))


if __name__ == '__main__':
    # a()
    # print(sys.argv[1],sys.argv[2],sys.argv[3],sys.argv[4])
    create_note(sys.argv[1],sys.argv[2],sys.argv[3],sys.argv[4])#,sys.argv[4]